package com.study.shiro;

import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.SimpleAuthenticationInfo;
import org.apache.shiro.realm.AuthenticatingRealm;

public class ShiroRealm extends AuthenticatingRealm {

    @Override
    protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authenticationToken) throws AuthenticationException {
        System.out.println("进入ShiroRealm:["+getClass()+"]");
        Object Username="admin";
        String pwd="123456";
        AuthenticationInfo info = new SimpleAuthenticationInfo(Username, pwd, null, getName());
        return info; //框架完成验证
    }
}
